# ifndef DEF_EVENTLISTENER
# define DEF_EVENTLISTENER

# include "Source.h"

# include "Module.h"

/*
*	This class handles the keyboards and the mouse entries.
*/

class EventListener : public Module, public OIS::KeyListener, public OIS::MouseListener
{
	public:

	EventListener( Game*);
	~EventListener();

	void setWindow( Ogre::RenderWindow*);
	void setWorld( World*);

	OIS::Mouse* getMouse();

	void init( Renderer*, GUI*, AI*);

	void oneFrame();

	protected:

	virtual bool keyPressed( const OIS::KeyEvent&);
	virtual bool keyReleased( const OIS::KeyEvent&);

	virtual bool mouseMoved( const OIS::MouseEvent&);
	virtual bool mousePressed( const OIS::MouseEvent&, OIS::MouseButtonID);
	virtual bool mouseReleased( const OIS::MouseEvent&, OIS::MouseButtonID);

	private:

	virtual void handleEvents();

	OIS::InputManager* myInputManager;
	OIS::Keyboard* myKeyboard;
	OIS::Mouse* myMouse;
	
	Ogre::RenderWindow* myWindow;

	Renderer* myRenderer;
	GUI* myGUI;
	AI* myAI;

	World* myWorld;
	Hero* myHero;
};

# endif